Version

GetDescendantFromType<T>(DependencyObject,Boolean,DependencyObjectSearchCallback<T>,Type[]) Method

Get a descendant parent based on its type.
Syntax
'Declaration
 
Public Overloads Shared Function GetDescendantFromType(Of T As DependencyObject)( _
   ByVal parent As DependencyObject, _
   ByVal allowSubclassOfType As Boolean, _
   ByVal callback As Utilities.DependencyObjectSearchCallback(Of T), _
   ByVal typesToIgnore() As Type _
) As T
public static T GetDescendantFromType<T>( 
   DependencyObject parent,
   bool allowSubclassOfType,
   Utilities.DependencyObjectSearchCallback<T> callback,
   Type[] typesToIgnore
)
where T: DependencyObject

Parameters

parent
DependencyObject whose descendants are to be searched.
allowSubclassOfType
True if subclasses of type may be considered.
callback
Delegate that should be invoked when a potential match is located. Return false from the callback to indicate that the object is not a match and that the search should be continued. Otherwise return true to indicate that the specified object should be returned from the method.
typesToIgnore
Array of types identifying descendants that should not be searched.

Type Parameters

T

Return Value

A descendant parent of the specified type or null if not found.
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also